/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package control;

import java.io.IOException;
import java.sql.SQLException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author Eduarda
 */
public abstract class Comando {
    private HttpServletRequest request;
    private HttpServletResponse response;
    
    public abstract void executar(HttpServletRequest request, HttpServletResponse response) throws ClassNotFoundException, SQLException, IOException, ServletException ;
    public void forward(String destino) throws ServletException, IOException{  
            RequestDispatcher rd = getRequest().getRequestDispatcher(destino);  
            rd.forward(getRequest(), getResponse());   
    }
    
     public HttpServletRequest getRequest() {
        return request;
    }
      public HttpServletResponse getResponse() {
        return response;
    }
}
